/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package edu.upc.fulbitofacil;

/**
 *
 * @author SISTEMAS
 */
import edu.upc.fulbitofacil.dao.FulbitoFacilException;
import edu.upc.fulbitofacil.entity.Personas;
import edu.upc.fulbitofacil.dao.AdmPersonaDAO;
import java.util.*;
import org.junit.*;

public class AdmPersonaDAOTEST {

    @Test
    public void RegistrarResultadoPersonas() throws FulbitoFacilException {

        //------------------------------
        //preparamos el ejemplo
        //------------------------------

        // REGISTRAR: Registrar personas

        String idpers = "0000000001";       //Nro. Autogenerado
        String tippers = "D";                //(D)Due�o / (C) Cliente
        String nompers = "Jose";
        String appat = "Santos";
        String apmat = "Alvarez";
        String sexo = "M";                //(M)Masculino / (F)Femenino
        String tipdoc = "01";               //(01)DNI / (02)Pasaporte / (03)Lib.Militar
        String numdoc = "99999999";
        String email = "jose@hotmail.com"; //Correo electronico
        String passw = " ";
        Calendar fecnac = Calendar.getInstance();
        fecnac.set(1980, 03, 18);
        String nrocel = "99999999";

        AdmPersonaDAO regpersona = new AdmPersonaDAO();

        //ejecutar
        regpersona.registrarPersona(idpers, tippers, nompers, appat, apmat,
                sexo, tipdoc, numdoc, email, passw,
                fecnac, nrocel);

        //Busca registro
        Personas persona = regpersona.buscarPersona(idpers);

        // Verificar
        Assert.assertNotNull(persona);
    }
}
